const resuServ = require('../service/resumeServ')

const resuCtrl = {
  // 查看处理进度
  resuStatus:async (ctx) => {
    const id = ctx.request.body._id
    const res =  await resuServ.resuStatusServ(id)
    ctx.body = {
      code: 0,
      msg: 'success',
      data:res
    }
  },
  // 更新简历状态
  updateResuStatus:async (ctx) => {
    const params = ctx.request.body
    await resuServ.updateResuStatusServ(params)
    ctx.body = {
      code: 0,
      msg: 'success',
    }
  },
  // 投递简历
  sendResume: async (ctx) => {
    const params = ctx.request.body
    await resuServ.sendResumeServ(params)
    ctx.body = {
      code: 0,
      msg: 'success',
    }
  },
  // 当前投递状态
  sendReStatus: async (ctx) => {
    const params = ctx.request.body
    const res = await resuServ.sendReStatuServ(params)
    ctx.body = {
      code: 0,
      msg: 'success',
      data: res
    }
  },
  // 删除投递信息
  deleteDeliver: async (ctx) => {
    const id = ctx.request.body._id
    const res = await resuServ.deleteDeliverServ(id)
    ctx.body = {
      code: 0,
      msg: 'success',
      data: res
    }
  },
  // 查接收的简历
  receResu: async (ctx) => {
    const userId = ctx.query.userId
    const res = await resuServ.receResuServ(userId)
    ctx.body = {
      code: 0,
      msg: 'success',
      data: res
    }
  },
  // 投出简历列表
  deliverResu : async (ctx) => {
    const userId = ctx.query.userId
    const res = await resuServ.deliverResuServ(userId)
    ctx.body = {
      code: 0,
      msg: 'success',
      data: res
    }
  },
}

module.exports = resuCtrl